import Func from '@/utils/functions'

const proxy = {
    async orderIndex(params = {}, header = {}) {
        return uni.request({
            url: '/v1/order/index',
            method: 'GET',
            data: params,
            header
        })
    },
    async orderShow(params = {}, header = {}) {
        return uni.request({
            url: '/v1/order/show',
            method: 'GET',
            data: params,
            header
        })
    },
    async orderDeliveryer(params = {}, header = {}) {
        return uni.request({
            url: '/v1/order/deliveryer',
            method: 'PUT',
            data: params,
            header
        })
    },
    async orderUpdate(params = {}, header = {}) {
        return uni.request({
            url: '/v1/order/update',
            method: 'PUT',
            data: params,
            header
        })
    }
}

const p = Func.proxyEndpoint(proxy)

export const orderIndex = p.orderIndex
export const orderShow = p.orderShow
export const orderDeliveryer = p.orderDeliveryer
export const orderUpdate = p.orderUpdate